package cn.tedu.spring.eg4;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String title;

    public ShopController() {
        System.out.println("实例化阶段无参构造方法");
    }
    @Value("商品名称")
    public void setTitle(String title) {
        this.title = title;
        System.out.println("赋值阶段set方法");
    }
    @PostConstruct
    public void init(){
        System.out.println("初始化");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("销毁阶段");
    }

}
